package readerRSS;

import MVC.IModel;
import java.util.ArrayList;
import javax.swing.ListModel;
import javax.swing.event.ListDataListener;

/**
 *
 * @author thomas
 */
public class RssChannelListModel implements ListModel, IModel {

    private ArrayList<RssChannelModel> _myChannelList;

    /**
     *
     * @param channelList
     */
    public RssChannelListModel(ArrayList<RssChannelModel> channelList) {
        _myChannelList = channelList;
    }

    /**
     *
     * @param obj
     */
    public RssChannelListModel(RssChannelListModel obj) {
        this._myChannelList = obj.getChannelList();
    }

    @Override
    public int getSize() {
        return _myChannelList.size();
    }

    @Override
    public Object getElementAt(int i) {
        return _myChannelList.get(i);
    }

    @Override
    public void addListDataListener(ListDataListener ll) {
    }

    @Override
    public void removeListDataListener(ListDataListener ll) {
    }

    /**
     * @return the _myItemList
     */
    public ArrayList<RssChannelModel> getChannelList() {
        return _myChannelList;
    }

    /**
     * @param channelList the _myItemList to set
     */
    public void setChannelList(ArrayList<RssChannelModel> channelList) {
        this._myChannelList = channelList;
    }
}
